import fetch from 'common/src/utils/fetch';
import baseUrl from './env';
import UTILS from "common/src/utils/utils";
// 获取当前系统时间
function getCurrentSystemTime(key) {
  return fetch({
      url: `${baseUrl}/common/getCurrentDate`,
      method: 'get'
  });
}
// 下载步骤1
function downloadGetKey(key) {
  return fetch({
      url: `${baseUrl}/export/result/${key}`,
      method: 'get'
  });
}
// 下载步骤2
function downloadGetPath(params) {
  return fetch({
      url: baseUrl + '/export/file?file=' + params.file,
      method: 'get'
  });
}
// 根据学院查询相关专业
function getMajorByCollage(data) {
  return fetch({
      url: baseUrl + "/common/getDegreeByCollege",
      method: 'post',
      data
  });
}
// 项目子类别下拉框数据
function getXMZLBOptions(data) {
  return fetch({
      url: baseUrl + "/projectTypes/selectTypes",
      method: 'post',
      data
  });
}
// 根据项目类型查找留学内容
function getLXNROptions(data) {
  return fetch({
      url: baseUrl + "/studyAbroad/selectContent",
      method: 'post',
      data
  });
}
// 国家公派项目名称下拉框数据
function getGJGPOptions(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeProject/listNationalProject",
      method: 'post',
      data
  });
}
// 短期访学项目名称下拉框数据
function getDQFXOptions(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeProject/listShortTermProject",
      method: 'post',
      data
  });
}
// 用于学校管理员去新增其他境外交流项目
function addProjectManage(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeProject/addProject",
      method: 'post',
      data
  });
}
// 用于学校管理员去修改其他境外交流项目
function editProjectManage(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeProject/editProject",
      method: 'post',
      data
  });
}
// 用于学校管理员删除其他境外交流项目
function deleteProjectManage(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeProject/deleteProject",
      method: 'post',
      data
  });
}
// 查询其他境外交流项目列表
function getProjectManageList(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeProject/listProject",
      method: 'post',
      data
  });
}
// 导出其他境外交流项目列表--获取路径
function getProjectManageExportKey(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeProject/exportExcelList",
      method: 'post',
      data
  });
}
// 导出其他境外交流项目列表--导出
function exportProjectManageList(path) {
  return fetch({
      url: `${baseUrl}/pgOverseasExchangeProject/downloadFile?path=` + path,
      method: 'get'
  });
}
// 用于学校管理员去停用某个其他境外交流项目
function deactivateProjectManage(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeProject/changeProjectStatus",
      method: 'post',
      data
  });
}
// 其他境外交流项目详情
function getProjectManageDetail(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeProject/projectDetail",
      method: 'post',
      data
  });
}
// 查询其他境外交流项目申请审核列表
function getProjectApplicationList(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/list",
      method: 'post',
      data
  });
}
// 查询其他境外交流项目申请审核详情
function getProjectApplicationDetail(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/get",
      method: 'post',
      data
  });
}
// 学生申请其他境外交流项目时，首先判断学生是否存在不及格课程，数据来源于研究生不及格成绩管理
function checkExistsFailedCourse(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/checkExistsFailedCourse",
      method: 'post',
      data
  });
}
// 指定专家列表
function getDesignedExpertsList(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/listDesignatedExperts",
      method: 'post',
      data
  });
}
// 查询出国及经费历史信息
function getOutAndFundingHistories(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/queryHistories",
      method: 'post',
      data
  });
}
// 保存申请其他境外交流项目
function saveProjectApplication(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/add",
      method: 'post',
      data
  });
}
// 管理员初审后，可指定专家进行评审，可批量
function specifyExpertsAudit(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/assignExpert",
      method: 'post',
      data
  });
}
// 修改申请其他境外交流项目
function editProjectApplication(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/modify",
      method: 'post',
      data
  });
}
// 删除申请其他境外交流项目
function deleteProjectApplication(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/remove",
      method: 'post',
      data
  });
}
// 提交申请其他境外交流项目
function applyProjectApplication(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/submit",
      method: 'post',
      data
  });
}
// 撤销申请其他境外交流项目
function revokeApplyProjectApp(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/cancel",
      method: 'post',
      data
  });
}
// 审核申请其他境外交流项目
function auditApplyProjectApp(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/approval",
      method: 'post',
      data
  });
}
// 查询回国详情
function selectReturnHomeDetail(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeBack/get",
      method: 'post',
      data
  });
}
// 保存申请回国
function saveApplyReturnHome(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeBack/add",
      method: 'post',
      data
  });
}
// 修改申请回国
function modifyApplyReturnHome(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeBack/modify",
      method: 'post',
      data
  });
}
// 提交回国报销
function submitReturnHomeReimburse(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeBack/submit",
      method: 'post',
      data
  });
}
// 撤销回国报销
function revokeReturnHomeReimburse(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeBack/cancel",
      method: 'post',
      data
  });
}
// 审核回国报销
function auditReturnHomeReimburse(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeBack/approval",
      method: 'post',
      data
  });
}
// 模板下载
function templateDownload(params) {
  return fetch({
      url: `${baseUrl}/pgOverseasExchangeTemplate/download?type=${params.type}`,
      responseType: 'blob',
      method: 'get'
  }).then(res => {
      UTILS.downloadFile(res, params.fileName, 'application/msword;charset=utf-8');
  });
}
// 批量下载附件，下载出国其他境外交流项目的附件，打包成压缩包下载
function batchDownload(data) {
  return fetch({
      url: `${baseUrl}/pgOverseasExchangeFile/batchDownload`,
      method: 'post',
      data
  });
}
// 资助函下载
function grantLetterDownload(params) {
  return fetch({
      url: `${baseUrl}/pgOverseasExchangeApply/letter?applyId=${params.applyId}`,
      method: 'get'
  });
}
// 文件附件下载
function fileAnnexDownload(params) {
  return fetch({
      url: `${baseUrl}/pgOverseasExchangeFile/download?fileId=${params.fileId}`,
      method: 'get'
  });
}
// 打印报销单
function printReimbursementForm(params) {
  return fetch({
      url: `${baseUrl}/pgOverseasExchangeApply/receipt?applyId=${params.applyId}`,
      method: 'get'
  });
}
// 导出其他境外交流项目列表
function exportProjectAppList(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/export",
      method: 'post',
      responseType: 'blob',
      data
  });
}
// 项目子类别下拉框数据
function appSubTypeOptions(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/projectSubCategory",
      method: 'post',
      data
  });
}
// 查询学生基本信息
function getStundentInfo(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/studentDetail",
      method: 'post',
      data
  });
}
// 拟留学学校
function getStudyAbroadCollege(data) {
  return fetch({
      url: baseUrl + "/overseasCollege/listCollege",
      method: 'post',
      data
  });
}
// 查询全部一级学科
function getFirseMajors(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/queryFirstMajor",
      method: 'post',
      data
  });
}
// 判定登录用户
function judgeUserInfo() {
  return fetch({
      url: baseUrl + "/pgIntlConference/recommendRole",
      method: 'get'
  });
}
// 学生在出国时出现问题，学校管理员可以进行异动处理
function goAbroadChange(data) {
  return fetch({
      url: baseUrl + "/pgAdmissionConfirm/goAbroadChange",
      method: 'post',
      data
  });
}
// 学校根据国家定的指标数进行国家公派项目的最终名单确认
function lastConfirmList(data) {
  return fetch({
      url: baseUrl + "/pgAdmissionConfirm/listPassDesignationByGovProject",
      method: 'post',
      data
  });
}
// 学校根据国家订的指标数进行国家公派项目的最终名单确认
function lastListConfirm(data) {
  return fetch({
      url: baseUrl + "/pgAdmissionConfirm/nameListConfirm",
      method: 'post',
      data
  });
}
// 导出国家公派录取确认列表，支持勾选导出，如果不勾选，默认导出全部数据
function exportLastList(data) {
  return fetch({
      url: baseUrl + "/pgAdmissionConfirm/exportExcelList",
      method: 'post',
      data
  });
}
// 获取国家公派项目申请异动记录
function getChangeRecord(data) {
  return fetch({
      url: baseUrl + "/pgAdmissionConfirm/listAbroadChangeRecord",
      method: 'post',
      data
  });
}
// 导出其他境外交流项目列表
function exportExternalExchangeRecord(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/export",
      method: 'post',
      data
  });
}
// 学校管理员查看所有学生已提交的数据
function selectExternalExchangeRecord(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/view",
      method: 'post',
      data
  });
}
// 学校管理员导出所有学生已提交的数据
function exportExternalExchangeRecords(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeApply/exportList",
      method: 'post',
      data
  });
}
// 查询交流大学信息，可通过所属国家查询
function getCollegeByNationCode(data) {
  return fetch({
      url: baseUrl + "/overseasCollege/getCollegeListByNationCode",
      method: 'post',
      data
  });
}
// 获取批量附件
function getBatchFile(data) {
  return fetch({
      url: baseUrl + "/pgOverseasExchangeFile/getFileInfoList",
      method: 'post',
      data
  });
}
export default {
    'getCurrentSystemTime': getCurrentSystemTime,
    'downloadGetKey': downloadGetKey,
    'downloadGetPath': downloadGetPath,
    'getMajorByCollage': getMajorByCollage,
    'getXMZLBOptions': getXMZLBOptions,
    'getLXNROptions': getLXNROptions,
    'getGJGPOptions': getGJGPOptions,
    'getDQFXOptions': getDQFXOptions,
    'addProjectManage': addProjectManage,
    'editProjectManage': editProjectManage,
    'deleteProjectManage': deleteProjectManage,
    'getProjectManageList': getProjectManageList,
    'getProjectManageExportKey': getProjectManageExportKey,
    'exportProjectManageList': exportProjectManageList,
    'deactivateProjectManage': deactivateProjectManage,
    'getProjectManageDetail': getProjectManageDetail,
    'getProjectApplicationList': getProjectApplicationList,
    'getProjectApplicationDetail': getProjectApplicationDetail,
    'checkExistsFailedCourse': checkExistsFailedCourse,
    'getDesignedExpertsList': getDesignedExpertsList,
    'getOutAndFundingHistories': getOutAndFundingHistories,
    'saveProjectApplication': saveProjectApplication,
    'specifyExpertsAudit': specifyExpertsAudit,
    'editProjectApplication': editProjectApplication,
    'deleteProjectApplication': deleteProjectApplication,
    'applyProjectApplication': applyProjectApplication,
    'revokeApplyProjectApp': revokeApplyProjectApp,
    'auditApplyProjectApp': auditApplyProjectApp,
    'selectReturnHomeDetail': selectReturnHomeDetail,
    'saveApplyReturnHome': saveApplyReturnHome,
    'modifyApplyReturnHome': modifyApplyReturnHome,
    'submitReturnHomeReimburse': submitReturnHomeReimburse,
    'revokeReturnHomeReimburse': revokeReturnHomeReimburse,
    'auditReturnHomeReimburse': auditReturnHomeReimburse,
    'templateDownload': templateDownload,
    'batchDownload': batchDownload,
    'grantLetterDownload': grantLetterDownload,
    'fileAnnexDownload': fileAnnexDownload,
    'printReimbursementForm': printReimbursementForm,
    'exportProjectAppList': exportProjectAppList,
    'appSubTypeOptions': appSubTypeOptions,
    'getStundentInfo': getStundentInfo,
    'getStudyAbroadCollege': getStudyAbroadCollege,
    'getFirseMajors': getFirseMajors,
    'judgeUserInfo': judgeUserInfo,
    'goAbroadChange': goAbroadChange,
    'lastConfirmList': lastConfirmList,
    'lastListConfirm': lastListConfirm,
    'exportLastList': exportLastList,
    'getChangeRecord': getChangeRecord,
    'exportExternalExchangeRecord': exportExternalExchangeRecord,
    'selectExternalExchangeRecord': selectExternalExchangeRecord,
    'exportExternalExchangeRecords': exportExternalExchangeRecords,
    'getCollegeByNationCode': getCollegeByNationCode,
    'getBatchFile': getBatchFile
};

